class Solution(object):
    def sortSentence(self, s):
        t = s.split(' ')
        t.sort(key=lambda x: x[-1])
        t = [word[:-1] for word in t]
        return ' '.join(t)

